/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "RgnDialog.h"

#include "afxwin.h"

#include "WorkCfgElement.h"
#include "MCCLabel.h"
#include "MCCLine.h"

#include "WorkMethods.h"

#include "DlgWmiSel.h"
#include "DlgBldWOL.h"
#include "DlgBldShutdown.h"

class DlgScanJob : public CRgnDialog
{
	DECLARE_DYNAMIC(DlgScanJob)

protected:
	DlgWmiSel      dlgWmiSel;
	DlgBldWOL      dlgBldWOL;
	DlgBldShutdown dlgBldShutdown;

	WorkMethods workMethods;
	WorkDefinitions wd;

	void Initialize(void);
	void PhaseToData(void);
	void PhaseFromData(void);
	void MethodToData(void);
	void MethodFromData(void);
	void WorkCfgToData(void);
	void WorkCfgFromData(void);

	void UpdateDataLabels(WorkMethodType);

	virtual void ResizeChilds(void);
	virtual bool GetMinimumSize(RECT*);

	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	MCCLabel  staPhase;
	MCCLabel  staMethod;
	MCCLabel  staData;
	MCCLabel  staInfo;
	MCCLine   staLine1;
	MCCLine   staLine2;
	CComboBox cmbPhase;
	CComboBox cmbMethod;
	CEdit     edtData;
	CButton   btnBuild;
	CButton   btnOk;
	CButton   btnCancel;

	int     vPhase;
	int     vMethod;
	CString vData;

	BuildButtonType buildButtonType;

	virtual BOOL OnInitDialog();

	virtual void OnCancel();
	virtual void OnOK();
	afx_msg void OnBnClickedBtnBuild();
	afx_msg void OnBnClickedBtnOk();
	afx_msg void OnBnClickedBtnCancel();
	afx_msg void OnCbnSelchangeCmbMethod();

	DECLARE_MESSAGE_MAP()

public:
	DlgScanJob(CWnd* pParent = NULL);   // standard constructor
	virtual ~DlgScanJob();

	enum { IDD = IDD_DLG_JOB };			// Dialog Data

	MSkin* skinIn;

	WorkCfgElement wce;
	bool retVal;
};
